<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class GoodComment extends Model
{
    use HasFactory;
    //定义商品评论表
    public $table='goods_comment';

    /**
     * @param $id
     * @return mixed
     * User: 张浩
     * Date: 2022/11/25
     * Time: 14:51
     * 根据商品id获取所有评论
     */
    public static function goodcommentfirst($id)
    {
        return self::where('goods_id',$id)->get()->toArray();
    }
}
